<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML>
<html>
  <head>
    <title>分类维护</title>
    <base href="<%=basePath%>">
	<link rel="stylesheet" type="text/css" href="/css/maintable.css" ></link>
	<style type="text/css">
		.catenametd{
			width:140px;
		}	
		.secondtd{
			width:23%;
		}

	</style>
	<script type="text/javascript" src="/js/jquery-1.8.0.js"></script>

  </head>
  
  <body>
    <div class ="div_title">
			<div class="div_titlename"><span>商品维护  分类管理</span></div>
	</div>
	   	<table class="main_table">
	  	 	<tr>
	   			<th colspan="2">一级分类</th><th colspan="2">二级分类</th>
	   		</tr>
	   		<c:forEach var="cate" items="${cateList}">
	   			<tr>
	   				<td class="catenametd">
	   					<a style="color:#295568" title="${cate.des}">${cate.cateName }</a>
	   				</td>
	   				<td class="secondtd">
	   					 <a href="GoodsServlet.do?flag=goto_updatebigcate&id=${cate.id}">修改</a> | 
	   					 <a onclick="return confirm('确定要删除此分类吗?')" href="GoodsServlet.do?flag=delbigcate&id=${cate.id}">删除</a>
	   				</td>

	   				<td class="catenametd">	
	   					<c:forEach  var="cate_sub" items="${cate.subCateList }">
	   							<a style="color:#295568" title="${cate_sub.des }">${cate_sub.cateName }</a> <br>		
	   					</c:forEach>
	   				</td>
	   				<td>
	   					<c:forEach  var="cate_sub" items="${cate.subCateList }">
	   							<a href="GoodsServlet.do?id=${cate_sub.id}&flag=goto_updatesmallcate"> 修改 </a> |
	   						    <a onclick="return confirm('确定要删除此分类吗?')" href="GoodsServlet.do?flag=delsmallcate&id=${cate_sub.id}"> 删除 </a><br>
	   					</c:forEach>
	   				</td>
	   			</tr>
	   		</c:forEach>	  		
	   	</table>
   	
   	<script>
   		$(function(){
   			var msg="${msg}";
	   		if(msg!=""){
	   			alert(msg);
	   		}
   		})
   	</script>
   	
  </body>
</html>
